import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

///
///Author: YYF
///Date: 2022-04-01 14:06:18
///Description:
///

Future<bool?> toastInfo({
  required String msg,
  Color backgroundColor = Colors.black,
  Color textColor = Colors.white,
}) {
  return Fluttertoast.showToast(
    msg: msg,
    toastLength: Toast.LENGTH_SHORT,
    gravity: ToastGravity.CENTER,
    timeInSecForIosWeb: 1,
    backgroundColor: backgroundColor,
    textColor: textColor,
    fontSize: 16.sp,
  );
}

toastErrorInfo(String message) {
  BrnToast.show(
    message,
    Get.context!,
    preIcon: Image.asset(
      "assets/image/icon_toast_fail.png",
      width: 24,
      height: 24,
    ),
    duration: BrnDuration.long,
  );
}
